import {Dimensions, StatusBar, Platform, PixelRatio} from 'react-native';
import area from './area.json';
//手机屏幕的宽度
export const width = Dimensions.get('window').width;
//手机屏幕的高度
export const height = Dimensions.get('window').height;
var lastNavTime = "";

export const jumpPage=(navigation,page,params)=>{
  if(lastNavTime+1000 >= Date.now()){
    return;
  }
  lastNavTime = Date.now();
  if(navigation){
    navigation.push(page,params);
  }
}
export const createAreaData=()=>{
  let data = [];
  let len = area.length;
  for(let i=0;i<len;i++){
      let city = [];
      for(let j=0,cityLen=area[i]['city'].length;j<cityLen;j++){
          let _city = {};
          _city[area[i]['city'][j]['name']] = area[i]['city'][j]['area'];
          city.push(_city);
      }

      let _data = {};
      _data[area[i]['name']] = city;
      data.push(_data);
  }
  return data;
}